//
//  VOH_SD_RegionalradioModel.m
//  VoiceOfHeart
//
//  Created by lanou3g on 16/8/19.
//  Copyright © 2016年 吉龙. All rights reserved.
//

#import "VOH_SD_RegionalradioModel.h"
#import "VOHRadioPlayerURLModel.h"
@implementation VOH_SD_RegionalradioModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    if ([key isEqualToString:@"radioPlayUrl"]) {
        self.RPURL = [[VOHRadioPlayerURLModel alloc]init];
        [self.RPURL setValuesForKeysWithDictionary:value];
    }
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeInteger:self.recommendType forKey:@"recommendType"];
    [aCoder encodeObject:self.picPath forKey:@"picPath"];
    [aCoder encodeInteger:self.radioId forKey:@"radioId"];
    [aCoder encodeObject:self.rname forKey:@"rname"];
    [aCoder encodeObject:self.radioCoverSmall forKey:@"radioCoverSmall"];
    [aCoder encodeObject:self.radioCoverLarge forKey:@"radioCoverLarge"];
    [aCoder encodeInteger:self.programScheduleId forKey:@"programScheduleId"];
    [aCoder encodeObject:self.programName forKey:@"programName"];
    [aCoder encodeObject:self.startTime forKey:@"startTime"];
    [aCoder encodeObject:self.endTime forKey:@"endTime"];
    [aCoder encodeInteger:self.radioPlayCount forKey:@"radioPlayCount"];
    [aCoder encodeObject:self.RPURL forKey:@"RPURL"];
}


- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.recommendType = [aDecoder decodeIntegerForKey:@"recommendType"];
        self.picPath = [aDecoder decodeObjectForKey:@"picPath"];
        self.radioId = [aDecoder decodeIntegerForKey:@"radioId"];
        self.rname = [aDecoder decodeObjectForKey:@"rname"];
        self.radioCoverSmall = [aDecoder decodeObjectForKey:@"radioCoverSmall"];
        self.radioCoverLarge = [aDecoder decodeObjectForKey:@"radioCoverLarge"];
        self.programScheduleId = [aDecoder decodeIntegerForKey:@"programScheduleId"];
        self.programName = [aDecoder decodeObjectForKey:@"programName"];
        self.startTime = [aDecoder decodeObjectForKey:@"startTime"];
        self.endTime = [aDecoder decodeObjectForKey:@"endTime"];
        self.radioPlayCount = [aDecoder decodeIntegerForKey:@"radioPlayCount"];
        self.RPURL = [aDecoder decodeObjectForKey:@"RPURL"];
        
    }
    
    return self;
}


@end
